﻿using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using Demo.Identity.Permissions.Dto;
using Volo.Abp.Application.Services;

namespace Demo.Identity.Permissions;

/// <summary>
/// 权限管理应用服务接口 
/// </summary>
public interface ISysPermissionAppService:IApplicationService
{
    /// <summary>
    /// 按服务注册权限
    /// </summary>
    /// <param name="serviceName">服务名称</param>
    /// <param name="permissions">权限列表</param>
    /// <returns></returns>
    Task<bool> RegistPermission(string serviceName, List<SysPermissionDto> permissions);

    /// <summary>
    /// 按服务获取权限
    /// </summary>
    /// <param name="serviceName">服务名称</param>
    /// <returns>查询结果</returns>
    Task<List<SysPermissionDto>> GetPermissions(string serviceName);

    /// <summary>
    /// 获取完整权限树
    /// </summary>
    /// <param name="Permission"></param>
    /// <returns>查询结果</returns>
    Task<List<PermissionTreeDto>> GetPermissionTree();

    /// <summary>
    /// 获取用户权限码
    /// </summary>
    /// <param name="userId">用户编号</param>
    /// <returns>查询结果</returns>
    Task<List<string>> GetUserPermissionCode(Guid userId);
}